package model.initializeEntity;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import model.entity.Company;
import model.entity.Medicine;

import BaseClass.BaseInitialize;

public class IntMedicine extends BaseInitialize<Medicine> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1507892996024525351L;

	@Override
	public void initialize() throws IOException {

		ObjectPath = "resource/Medicine";
		inFile = new InputStreamReader(new FileInputStream(ObjectPath), "MS950");
		brFile = new BufferedReader(inFile);

		while ((Line = brFile.readLine()) != null) {

			Medicine med = new Medicine();
			med.setMedicineName(Line);
			med.setCreatdate(new Timestamp(new Date().getDay()));
			med.setUpdatedate(new Timestamp(0));
			Objects.add(med);

		}

	}

}
